package com.heima.admin.controller.v1;

import com.heima.common.dtos.ResponseResult;
import com.heima.feignclient.client.WemediaFeign;
import com.heima.model.admin.dtos.NewsAuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class NewsAuthController {

    @Autowired
    WemediaFeign wemediaFeign;

    /**
     * 自媒体文章审核通过
     *
     * @return
     */
    @PostMapping("/api/v1/news_auth/auth_pass")
    public ResponseResult authPass(NewsAuthDto dto) {
        System.out.println(dto);
        return ResponseResult.ok();
    }

    /**
     * 自媒体文章审核不通过
     *
     * @return
     */
    @PostMapping("/api/v1/news_auth/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDto dto) {
        wemediaFeign.authFail(dto);
        return ResponseResult.ok();
    }


}
